package com.scenic.common.service;

import com.github.pagehelper.PageInfo;
import com.scenic.common.exception.ScenicSpotException;
import com.scenic.common.bean.User;

import java.util.List;
import java.util.Map;

public interface UserService {
    //登录
    User login(String username, String password) throws ScenicSpotException;
    //注册
    Boolean reg(User user) throws ScenicSpotException;
    //根据id删除
    Boolean  delete(Integer id) throws ScenicSpotException;
    //根据id修改
    Boolean update(User user) throws ScenicSpotException;
    //修改密码
    Boolean chgPwd(String newPwd, String OldPwd, String confirmPwd, Integer id) throws ScenicSpotException;
    //根据id查询
    User selectById(Integer id);
    //搜索 —— 分页查询
    PageInfo<User> selectByCondition(User condition, Integer pageNum, Integer pageSize);

    boolean chgPayPwd(String oldPassword, String oldPayPwd, String newPayPwd, String confirmPayPwd, Integer id) throws ScenicSpotException;

    List<Map<String, Object>> userTop5();

    void recharge(User user, Integer userId) throws ScenicSpotException;

}
